<form class="layui-form layui-box" style='padding:25px 30px 20px 0' action="__SELF__" data-auto="true" method="post">

    <div class="layui-form-item">
        <label class="layui-form-label">属性名称</label>
        <div class="layui-input-block">
            {if $vo and isset($vo.a_name)}
            <input name="a_name" value='{$vo.a_name|default=""}' title="请输入属性名称" placeholder="请输入属性名称" class="layui-input">
            {else}
            <input name="a_name" value='{$vo.a_name|default=""}' required="required" title="请输入属性名称" placeholder="请输入属性名称" class="layui-input">
            {/if}
        </div>
    </div>

    <div class="layui-form-item">
        <label class="layui-form-label">商品模型</label>
        <div class="layui-input-block">
            <select name='model_id' class='layui-select full-width' style='display:block'>
                {foreach $menus as $menu}
                <option value='{$menu.id}' {eq name="$menu.id" value="$vo.model_id|default=''"} selected {/eq} >{$menu.spl}{$menu.cname}</option>
                {/foreach}
            </select>
        </div>
    </div> 

    <div class="layui-form-item">
        <label class="layui-form-label">录入方式</label>
        <div class="layui-input-block">
            <label class="think-radio">
                <input {eq name="$vo.type|default=''" value="1"} checked {/eq}  {eq name="$vo.model_id|default=''" value=""} checked {/eq} type="radio" name="type" value="1" title="手工录入" style="display: inline-block;"> 手工录入
            </label>
            <label class="think-radio">
                <input {eq name="$vo.type|default=''" value="2"} checked {/eq} type="radio" name="type" value="2" title="从下面的列表中选择（一行代表一个可选值）" style="display: inline-block;"> 从下面的列表中选择（一行代表一个可选值）
            </label>
            <label class="think-radio">
                <input {eq name="$vo.type|default=''" value="3"} checked {/eq} type="radio" name="type" value="3" title="多文本框" style="display: inline-block;"> 多文本框
            </label>
        </div>
    </div>

    <div class="layui-form-item">
        <label class="layui-form-label">可选值列表</label>
        <div class="layui-input-block">
            <textarea class="layui-textarea" name="a_value">{$vo.a_value|default=""}</textarea>
            <span style="color: #9c0b0b;">录入方式为手工或者多行文本时，此输入框不需填写。</span>
        </div>
    </div>

    <div class="hr-line-dashed"></div>

    <div class="layui-form-item text-center">
        {if isset($vo['id'])}<input type='hidden' value='{$vo.id}' name='id'/>{/if}
        <button class="layui-btn" type='submit'>保存数据</button>
        <button class="layui-btn layui-btn-danger" type='button' data-confirm="确定要取消编辑吗？" data-close>取消编辑</button>
    </div>
</form>
